package cn.funeralobjects.upms.api;

import cn.funeralobjects.common.web.api.CommonCloudCrudRestApi;
import cn.funeralobjects.upm.web.model.MRole;
import cn.funeralobjects.upm.web.model.VRole;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import reactor.core.publisher.Mono;

import javax.validation.constraints.NotEmpty;

/**
 * 角色Api
 *
 * @author FuneralObjects
 * Create date: 2020/4/30 4:55 PM
 */
@Validated
public interface RoleApi extends CommonCloudCrudRestApi<VRole, MRole, Integer> {

    /**
     * 添加角色标签
     *
     * @param id  角色id
     * @param tag 标签名
     * @return 无返回
     */
    @PostMapping("/{id}/tag")
    Mono<Void> addRoleTag(@PathVariable Integer id, @NotEmpty @RequestParam String tag);

    /**
     * 获取匿名角色
     *
     * @return 匿名角色
     */
    @GetMapping("/anonymous")
    Mono<VRole> getAnonymous();
}
